package com.sdau.repairmaster.logic.tools;

import android.os.Handler;
import android.os.Message;
import android.util.Log;

import com.google.gson.Gson;
import com.sdau.repairmaster.logic.model.User;

import org.jetbrains.annotations.NotNull;

import java.io.IOException;
import java.util.concurrent.TimeUnit;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;

import static java.lang.Thread.sleep;

public class UserUtils {
    private String account;

    public   void setAccount(String account){
        this.account = account;
    }
    public String getAccount(){
        return this.account;
    }

    public static boolean checkPwd(String pwd){
        /*强密码(必须包含大小写字母和数字的组合，可以使用下划线，长度在 6-15 之间)：*/
        String pattern = "^(?=.*\\d)(?=.*[a-zA-Z])[a-zA-Z0-9_]{6,15}$";
        return pwd.matches(pattern);
    }

    /*检测密码是否为纯数字*/
    public static boolean checkPwdIsNum(String pwd){
        String pattern = "^[0-9]*$";
        return pwd.matches(pattern);
    }
}
